﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using NhanAi.Entity;
using NhanAi.DAO.Mix;
namespace NhanAi.Public
{
    public partial class Contact : PublicBasePage
    {
        
        protected void Page_Load(object sender, EventArgs e)
        {
            
       
        }

        protected void btnSubmit_Click(object sender, EventArgs e)
        {         
            if (IsValid)
            {
                SubscribingModel modSub = new SubscribingModel();
                Subscribing o = new Subscribing();
                o.Subscriber = txtFullname.Text;
                o.SubscriberEmail = txtEmail.Text;
                o.SubscribingDate = DateTime.Now;
                o.SubscribingContent = txtContent.Text;
                SubscribingExtension e1 = new SubscribingExtension("Tiêu đề",txtTitle.Text,0);
                SubscribingExtension e2 = new SubscribingExtension("Điện thoại", txtPhone.Text, 0);
                o.SubscribingExtensions = new List<SubscribingExtension>();
                o.SubscribingExtensions.Add(e1);
                o.SubscribingExtensions.Add(e2);
                modSub.Create(o);
                lblResult.Text = GetGlobalResourceObject("HmLanguage", "submit_thank").ToString();
            }
            else
            {
                lblResult.Text = GetGlobalResourceObject("HmLanguage","invalid_captcha").ToString();
            }
        }
    }
}